<?php
/**
 * 系统验证
 */
class CommonAction extends Action {
    public function _initialize(){    
        if(!isset($_SESSION['uid']) || !isset($_SESSION['unick'])) {
	        $this->redirect('Home/Login/index');
	    }
		$this->assign('uid', session('uid'));
		$this->assign('unick', session('unick'));
		$data = array();
	}
	
	
	/**
	 * 获取列表
	 */
	protected function getList($pTable, $tConn=''){
		$this->assign('datas', getList($pTable, $tConn, $tPage));
		$this->assign('pageinfo', $tPage);
	}
	
	/**
	 * 时间函数
	 * $tMonth = -1,-2,-3...
	 */
	protected function dates($tMonth){
		
		$beginTime = mktime(0,0,0,(date('m',time())+($tMonth-1)),date('t',time()),date('y',time()))+86400;
		$lastTime = mktime(0,0,0,date('m',time()),1,date('y',time()))-1;
		$tdate = array($beginTime,$lastTime);
		return $tdate;
	}
        
	
}